stylecontext: don't unset the current style info when clearing cache
authorBenjamin Otte <otte@redhat.com>
Mon, 27 Oct 2014 03:22:49 +0000 (04:22 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 7 Jan 2015 13:26:47 +0000 (14:26 +0100)
Instead, do it manually.

gtk/gtkstylecontext.c

index 05d5b13672aa30dc14b8d327d86410b7ecde0df8..c27ea3daa70265d322b66e1eb7a01cc8938297a7 100644 (file)
@@ -2626,8 +2626,6 @@ gtk_style_context_clear_cache (GtkStyleContext *context)
 
   priv = context->priv;
 
-  style_info_set_values (priv->info, NULL);
-
   for (l = priv->saved_nodes; l; l = l->next)
     {
       style_info_set_values (l->data, NULL);
@@ -2781,6 +2779,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
   if (!priv->invalid && change == 0 && _gtk_bitmask_is_empty (parent_changes))
     return;
 
+  g_assert (!gtk_style_context_is_saved (context));
+
   priv->pending_changes = 0;
   gtk_style_context_set_invalid (context, FALSE);
 
@@ -2803,9 +2803,9 @@ _gtk_style_context_validate (GtkStyleContext  *context,
       else
         {
           gtk_style_context_update_cache (context, parent_changes);
-          style_info_set_values (info, NULL);
         }
 
+      style_info_set_values (info, NULL);
       values = style_values_lookup (context);
 
       if (values != current)
@@ -2912,6 +2912,8 @@ gtk_style_context_invalidate (GtkStyleContext *context)
 
   gtk_style_context_clear_cache (context);
 
+  style_info_set_values (context->priv->info, NULL);
+
   changes = _gtk_bitmask_new ();
   changes = _gtk_bitmask_invert_range (changes,
                                        0,